﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="memberregform_parameter.aspx.cs" Inherits="YXShop.Web.admin.templates.label.memberregform_parameter" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>无标题页</title>
    <link href="../../style/admin.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
function ReturnValue()
{      
   //自定义内容
    var mystyle = document.getElementById("txtLabelContent").value;
     if(mystyle.indexOf("[#form_userid]")<=-1||mystyle.indexOf("[#form_pwd]")<=-1 ||
      mystyle.indexOf("[#form_repwd]")<=-1||mystyle.indexOf("[#form_question]")<=-1||
      mystyle.indexOf("[#form_answer]")<=-1||mystyle.indexOf("[#form_email]")<=-1||
      mystyle.indexOf("[#form_agree]")<=-1||mystyle.indexOf("[#form_submit]")<=-1){
	       alert("添加注册表单必须有固定样式");
	       return;
	    }
	var cnm ="[YX:unLoop,YX:LableType=Member,YX:Option=MemberRegForm]"+mystyle+"[/YX:unLoop]";	 
    parent.getValue(cnm);
	 CloseDiv();

}

    function getValue(value)
    {
        var textObj=document.getElementById("txtLabelContent");
        var textFeildValue=value;
        if(value!="") 
        {
            if(document.all)
            {     
                if(textObj.createTextRange && textObj.caretPos)
                {   
                    var caretPos=textObj.caretPos;   
                    caretPos.text=caretPos.text.charAt(caretPos.text.length-1)==''?textFeildValue+'':textFeildValue;   
                }
                else
                {   
                    textObj.value=textFeildValue;   
                }   
            }
            else
            {   
                if(textObj.setSelectionRange)
                {   
                    var rangeStart =textObj.selectionStart;   
                    var rangeEnd=textObj.selectionEnd;   
                    var tempStr1=textObj.value.substring(0,rangeStart);   
                    var tempStr2 =textObj.value.substring(rangeEnd);   
                    textObj.value=tempStr1+textFeildValue+tempStr2;   
                }
                else
                {   
                    alert("This version of Mozilla based browser does not support setSelectionRange");   
                }   
            }
        }
    }
    function setCaret(textObj)
    {   
        if(textObj.createTextRange)
        {   
            textObj.caretPos=document.selection.createRange().duplicate();   
        }   
    } 
function CloseDiv()
{
    parent.document.getElementById("LabelDivid").style.display="none";
}

</script>
</head>
<body>
<form id="form1" runat="server">
<div>
     <table style="width: 100%;" class="form_table_input" >
        <tr>
            <td>可选样式</td>
            <td>
             <asp:DropDownList ID="ddlNecessary" runat="server" onchange="javascript:getValue(this.value);">
             <asp:ListItem Value="" Text="-请选择样式-" /> 
                    <asp:ListItem Value="[#ValidateCode]" Text="验证码" />                
                    <asp:ListItem Value="[#form_realname]" Text="真实姓名" />
                    <asp:ListItem Value="[#form_tel]" Text="固定电话" />
                    <asp:ListItem Value="[#form_companyaddress]" Text="公司地址" />
                    <asp:ListItem Value="[#form_msn]" Text="MSN" />     
                    <asp:ListItem Value="[#form_street]" Text="街道地址" />
                    <asp:ListItem Value="[#form_fax]" Text="传真" />
                    <asp:ListItem Value="[#form_mobile]" Text="手机" />
                    <asp:ListItem Value="[#form_zipcode]" Text="邮政编码" />
                    <asp:ListItem Value="[#form_companyname]" Text="公司名称" />
                    <asp:ListItem Value="[#form_post]" Text="职位" />
            </asp:DropDownList>
            </td>
            
            <td>固定样式</td>
            <td>
             <asp:DropDownList ID="ddlForm" runat="server" onchange="javascript:getValue(this.value);">
             <asp:ListItem Value="" Text="-请选择样式-" />                 
                    <asp:ListItem Value="[#form_userid]" Text="用户名" />
                    <asp:ListItem Value="[#form_pwd]" Text="设置密码" />
                    <asp:ListItem Value="[#form_repwd]" Text="确认密码" />
                    <asp:ListItem Value="[#form_question]" Text="密保问题" />
                    <asp:ListItem Value="[#form_answer]" Text="您的答案" />
                    <asp:ListItem Value="[#form_email]" Text="电子邮件" />
                    <asp:ListItem Value="[#form_agree]" Text="同意商城条款" />
                    <asp:ListItem Value="[#form_submit]" Text="提交注册" />
            </asp:DropDownList>
            </td>
          </tr>
       
        <tr>
            <td colspan="4"><span style="color:Red">注：该样式是前台注册信息显示的主要样式，在定制表单时一定要添加该样式。</span>
                    <asp:TextBox runat="server" ID="txtLabelContent" height="200" onselect="setCaret(this);"  onclick="setCaret(this);"  onkeyup="setCaret(this);" Width="600" TextMode="MultiLine"></asp:TextBox>
            </td>
        </tr>
       
        <tr>
            <td colspan="4" align="center" style="text-align:center">
                <input id="bt_Exc" type="button" value="提交" onclick="ReturnValue()" />&nbsp;
                <input type="button" value=" 关闭 "  onclick="javascript:CloseDiv();" />
            </td>
        </tr>
     </table>
</div>
</form>
</body>
</html>
